{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import mlflow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['ActiveRun',\n",
       " '__all__',\n",
       " '__builtins__',\n",
       " '__cached__',\n",
       " '__doc__',\n",
       " '__file__',\n",
       " '__loader__',\n",
       " '__name__',\n",
       " '__package__',\n",
       " '__path__',\n",
       " '__spec__',\n",
       " '__version__',\n",
       " '_configure_mlflow_loggers',\n",
       " 'active_run',\n",
       " 'create_experiment',\n",
       " 'data',\n",
       " 'delete_tag',\n",
       " 'end_run',\n",
       " 'entities',\n",
       " 'exceptions',\n",
       " 'get_artifact_uri',\n",
       " 'get_tracking_uri',\n",
       " 'log_artifact',\n",
       " 'log_artifacts',\n",
       " 'log_metric',\n",
       " 'log_metrics',\n",
       " 'log_param',\n",
       " 'log_params',\n",
       " 'mlflow',\n",
       " 'projects',\n",
       " 'protos',\n",
       " 'run',\n",
       " 'search_runs',\n",
       " 'set_experiment',\n",
       " 'set_tag',\n",
       " 'set_tags',\n",
       " 'set_tracking_uri',\n",
       " 'start_run',\n",
       " 'store',\n",
       " 'tracking',\n",
       " 'utils',\n",
       " 'version',\n",
       " 'warnings']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(mlflow)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>run_id</th>\n",
       "      <th>experiment_id</th>\n",
       "      <th>status</th>\n",
       "      <th>artifact_uri</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [run_id, experiment_id, status, artifact_uri]\n",
       "Index: []"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mlflow.search_runs()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1m\u001b[36m420060ecb9714fa987007895c3cea5de\u001b[m\u001b[m \u001b[1m\u001b[36ma4bde268b866403b85b2de0a46608617\u001b[m\u001b[m\r\n",
      "\u001b[1m\u001b[36m7f9eb23777644af58559e2c51ad69d7a\u001b[m\u001b[m meta.yaml\r\n"
     ]
    }
   ],
   "source": [
    "!ls mlruns/5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>run_id</th>\n",
       "      <th>experiment_id</th>\n",
       "      <th>status</th>\n",
       "      <th>artifact_uri</th>\n",
       "      <th>metrics.time_total_s</th>\n",
       "      <th>metrics.val_loss</th>\n",
       "      <th>metrics.train_acc</th>\n",
       "      <th>metrics.sparse_level_l2</th>\n",
       "      <th>metrics.time_this_iter_s</th>\n",
       "      <th>metrics.sparse_level_l1</th>\n",
       "      <th>...</th>\n",
       "      <th>params.debug_sparse</th>\n",
       "      <th>params.batch_size_test</th>\n",
       "      <th>params.num_classes</th>\n",
       "      <th>params.data_dir</th>\n",
       "      <th>params.network</th>\n",
       "      <th>params.batch_size_train</th>\n",
       "      <th>params.dataset_name</th>\n",
       "      <th>params.input_size</th>\n",
       "      <th>params.model</th>\n",
       "      <th>params.mlflow_experiment_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>420060ecb9714fa987007895c3cea5de</td>\n",
       "      <td>5</td>\n",
       "      <td>FINISHED</td>\n",
       "      <td>file:///Users/lsouza/nta/nupic.research/projec...</td>\n",
       "      <td>161.146089</td>\n",
       "      <td>2.325689</td>\n",
       "      <td>0.10135</td>\n",
       "      <td>0.2</td>\n",
       "      <td>32.302321</td>\n",
       "      <td>0.2</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>~/nta/data</td>\n",
       "      <td>MLPHeb</td>\n",
       "      <td>10</td>\n",
       "      <td>MNIST</td>\n",
       "      <td>784</td>\n",
       "      <td>SparseModel</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>a4bde268b866403b85b2de0a46608617</td>\n",
       "      <td>5</td>\n",
       "      <td>FINISHED</td>\n",
       "      <td>file:///Users/lsouza/nta/nupic.research/projec...</td>\n",
       "      <td>160.076837</td>\n",
       "      <td>2.321328</td>\n",
       "      <td>0.10420</td>\n",
       "      <td>0.2</td>\n",
       "      <td>32.735992</td>\n",
       "      <td>0.2</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>~/nta/data</td>\n",
       "      <td>MLPHeb</td>\n",
       "      <td>10</td>\n",
       "      <td>MNIST</td>\n",
       "      <td>784</td>\n",
       "      <td>SparseModel</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>7f9eb23777644af58559e2c51ad69d7a</td>\n",
       "      <td>5</td>\n",
       "      <td>FINISHED</td>\n",
       "      <td>file:///Users/lsouza/nta/nupic.research/projec...</td>\n",
       "      <td>159.812787</td>\n",
       "      <td>2.333451</td>\n",
       "      <td>0.10240</td>\n",
       "      <td>0.2</td>\n",
       "      <td>32.459651</td>\n",
       "      <td>0.2</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>~/nta/data</td>\n",
       "      <td>MLPHeb</td>\n",
       "      <td>10</td>\n",
       "      <td>MNIST</td>\n",
       "      <td>784</td>\n",
       "      <td>SparseModel</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3 rows × 27 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                             run_id experiment_id    status  \\\n",
       "0  420060ecb9714fa987007895c3cea5de             5  FINISHED   \n",
       "1  a4bde268b866403b85b2de0a46608617             5  FINISHED   \n",
       "2  7f9eb23777644af58559e2c51ad69d7a             5  FINISHED   \n",
       "\n",
       "                                        artifact_uri  metrics.time_total_s  \\\n",
       "0  file:///Users/lsouza/nta/nupic.research/projec...            161.146089   \n",
       "1  file:///Users/lsouza/nta/nupic.research/projec...            160.076837   \n",
       "2  file:///Users/lsouza/nta/nupic.research/projec...            159.812787   \n",
       "\n",
       "   metrics.val_loss  metrics.train_acc  metrics.sparse_level_l2  \\\n",
       "0          2.325689            0.10135                      0.2   \n",
       "1          2.321328            0.10420                      0.2   \n",
       "2          2.333451            0.10240                      0.2   \n",
       "\n",
       "   metrics.time_this_iter_s  metrics.sparse_level_l1  ...  \\\n",
       "0                 32.302321                      0.2  ...   \n",
       "1                 32.735992                      0.2  ...   \n",
       "2                 32.459651                      0.2  ...   \n",
       "\n",
       "   params.debug_sparse  params.batch_size_test  params.num_classes  \\\n",
       "0                 True                      10                  10   \n",
       "1                 True                      10                  10   \n",
       "2                 True                      10                  10   \n",
       "\n",
       "   params.data_dir  params.network params.batch_size_train  \\\n",
       "0       ~/nta/data          MLPHeb                      10   \n",
       "1       ~/nta/data          MLPHeb                      10   \n",
       "2       ~/nta/data          MLPHeb                      10   \n",
       "\n",
       "  params.dataset_name params.input_size params.model  \\\n",
       "0               MNIST               784  SparseModel   \n",
       "1               MNIST               784  SparseModel   \n",
       "2               MNIST               784  SparseModel   \n",
       "\n",
       "  params.mlflow_experiment_id  \n",
       "0                           5  \n",
       "1                           5  \n",
       "2                           5  \n",
       "\n",
       "[3 rows x 27 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mlflow.search_runs('5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['ActiveRun',\n",
       " '__all__',\n",
       " '__builtins__',\n",
       " '__cached__',\n",
       " '__doc__',\n",
       " '__file__',\n",
       " '__loader__',\n",
       " '__name__',\n",
       " '__package__',\n",
       " '__path__',\n",
       " '__spec__',\n",
       " '__version__',\n",
       " '_configure_mlflow_loggers',\n",
       " 'active_run',\n",
       " 'create_experiment',\n",
       " 'data',\n",
       " 'delete_tag',\n",
       " 'end_run',\n",
       " 'entities',\n",
       " 'exceptions',\n",
       " 'get_artifact_uri',\n",
       " 'get_tracking_uri',\n",
       " 'log_artifact',\n",
       " 'log_artifacts',\n",
       " 'log_metric',\n",
       " 'log_metrics',\n",
       " 'log_param',\n",
       " 'log_params',\n",
       " 'mlflow',\n",
       " 'projects',\n",
       " 'protos',\n",
       " 'run',\n",
       " 'search_runs',\n",
       " 'set_experiment',\n",
       " 'set_tag',\n",
       " 'set_tags',\n",
       " 'set_tracking_uri',\n",
       " 'start_run',\n",
       " 'store',\n",
       " 'tracking',\n",
       " 'utils',\n",
       " 'version',\n",
       " 'warnings']"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(mlflow)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['MlflowClient',\n",
       " '_EXPERIMENT_ID_ENV_VAR',\n",
       " '_EXPERIMENT_NAME_ENV_VAR',\n",
       " '_RUN_ID_ENV_VAR',\n",
       " '_TRACKING_URI_ENV_VAR',\n",
       " '__all__',\n",
       " '__builtins__',\n",
       " '__cached__',\n",
       " '__doc__',\n",
       " '__file__',\n",
       " '__loader__',\n",
       " '__name__',\n",
       " '__package__',\n",
       " '__path__',\n",
       " '__spec__',\n",
       " '_get_store',\n",
       " 'artifact_utils',\n",
       " 'client',\n",
       " 'context',\n",
       " 'fluent',\n",
       " 'get_tracking_uri',\n",
       " 'registry',\n",
       " 'set_tracking_uri',\n",
       " 'utils']"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(mlflow.tracking)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
